package com.example.blog.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.blog.entity.Article;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.blog.entity.dto.article.ArticleAddOrUpdateDTO;
import com.example.blog.entity.vo.article.ArticleDetailInfoVO;
import com.example.blog.entity.vo.article.ArticleListVO;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 文章信息 服务类
 * </p>
 *
 * @author wlh
 * @since 2024-01-10
 */
public interface ArticleService extends IService<Article> {

    /**
     * 删除文章
     * @param id
     */
    void delete(Long id);


    Article getByIdNotNull(Serializable id);

    /**
     * 新增或者文章
     * @param articleAddOrUpdateDTO
     */
    void addOrUpdate(ArticleAddOrUpdateDTO articleAddOrUpdateDTO);

    List<ArticleListVO> getByFFId(Long ffid);

    Page<ArticleListVO> search(String value, Integer current, Integer size);

    ArticleDetailInfoVO viewById(Long id);

    Article incrementView(Article article, Integer num);
    Article incrementFavorite(Article article, Integer num);
    Article incrementLike(Article article, Integer num);

    void audit(List<Long> articleId, Integer status, String message);

    Page<Article> backPage(Integer current, Integer size, Integer status, String title);

    List<Article> getListByUser(Long userId);

    Map<String, Object> countByUser(Long userId);

    List<Article> myList(Integer status);
}
